home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Simple Help
/
SimpleHelpTypes.h
< prev
next >
Wrap
Text File
|
1994-07-13
|
4KB
|
121 lines
/****************************************************************************************
*
*
* SimpleHelpTypes.h -type declarations for simplehelp system
*
* ©1994, Graham Cox. All Rights Reserved.
*
* 9/2/94
*
****************************************************************************************/
#include "ScrollDialog.h"
typedef struct
{
WindowPtr ownerWindow; // window we are displayed in
ListHandle topicList; // list of topics
short topicID; // resource ID of topic list
short indentPixels; // number of pixels per indent value
short listItemID; // ID number of the list item
short textItemID; // ID number of the text item
Cell lastSelection; // remember which one we last displayed
short missingPageID; // ID of string to show missing page error
short fontID; // font to use
short fontSize; // size of the font
short hyperTextIndex; // index of hypertext style in style run table
short hyperTextStyle; // style of hypertext link
short curPageResID; // resource ID of the current page
short helpResFileRef; // refnum of res file, where used
short swapResFileRef; // refnum of current res file, where used and different
long reserved;
}
SimHelpRecord, *SimHelpPtr, **SimHelpHdl;
#define defaultFont geneva
#define defaultFontSize 9
#define defaultIndent 10
#define defaultTextResID 128
#define helpNextButton 2
#define helpPrevButton 3
#define pageMissingStrID 128
typedef struct
{
short indent;
short tStyle;
short tFont;
short pageID;
char topicString;
}
topicRec, *topicRecPtr;
typedef struct
{
short indent;
short tStyle;
short tFont;
short pageID;
Str255 topicString;
}
bigTopicRec, *bigTopicRecPtr;
typedef struct
{
short nTopics; // number of topic records
topicRec theTopic; // the first topic record
}
topicList, *topicListPtr, **topicListHdl;
#define topicListResType 'TPIC'
#define hyperTextIndexType 'Hypx'
typedef struct
{
short pageID; // hypertext page ID number
Str255 htMatchString; // Link text match string
}
hypEntry;
typedef struct
{
short nEntries; // number of entries on the page
hypEntry hEntries[1]; // array of records
}
htIndex, *htIndexPtr, **htIndexHdl;
SimHelpHdl GetNewHelpDialog(short DialogID,short listItem,short textItem,short topicID);
OSErr BuildTopicList(SimHelpHdl sHelp,Rect *listBox);
void ModalHelpDialog(SimHelpHdl sHelp,short *theItem);
void DisposeHelpDialog(SimHelpHdl sHelp);
DialogPtr GetHelpDialogHdl(SimHelpHdl sHelp);
pascal void ListDrawProc(WindowPtr theWindow,short theItem);
pascal void TopicListDef(short lMsg,Boolean lSelect,Rect *lRect,Cell lCell,
short lDataOffset,short lDataLength,ListHandle theList);
pascal Boolean ModelessHelp(SimHelpHdl sHelp,short theItem,EventRecord *theEvent);
void SwitchPage(SimHelpHdl sHelp,Cell clickCell);
void InstallPage(SimHelpHdl sHelp,short pageID);
Boolean HandleHelpItems(SimHelpHdl sHelp,short *theItem);
Handle GetFunctionHandle(ProcPtr functionAddress); // from SneakyJump.c
/*
pascal Boolean ModelessText(DialogPtr theDialog,short theItem,EventRecord *theEvent);
pascal Boolean TDFilter(DialogPtr theDialog,EventRecord *theEvent,short *itemHit);
*/
short GetHypertextStyleRef(TEHandle teRec,short theStyle);
short ResolveHypertextLink(SimHelpHdl sHelp,Point clickPt);
short MatchHyperLink(Str255 *testStr,htIndexHdl pageIndex);
void SetHyperlinkMatchStyle(SimHelpHdl sHelp,short theStyle);
void SetHelpResFile(SimHelpHdl sHelp,short refNum);
void SwapHelpResFile(SimHelpHdl sHelp,Boolean hSwapContext);
#define kSwapHelpIn TRUE
#define kSwapHelpOut FALSE